home *** CD-ROM | disk | FTP | other *** search
/ My Neighborhood / My Neighborhood.iso / mac / MacFiles / Zoo5.Dxr / 00048.ls < prev    next >
Encoding:
Text File  |  1997-11-18  |  3.8 KB  |  110 lines

  1. on exitFrame
  2.   global activeSprite, snap1, snap2, stickh1, stickh2, stickv1, stickv2, offLeft, offRight, onScaleList, side
  3.   if not snap1 and not snap2 then
  4.     if (the locH of sprite activeSprite > (stickh1 - 70)) and (the locH of sprite activeSprite < (stickh1 + 70)) and (the locV of sprite activeSprite > (stickv1 - 40)) and (the locV of sprite activeSprite < (stickv1 + 40)) then
  5.       if side <> "Left" then
  6.         set the locH of sprite activeSprite to stickh1
  7.         set the locV of sprite activeSprite to stickv1
  8.         set snap1 to 1
  9.         puppetSound(0)
  10.         puppetSound("Floop.S")
  11.         updateStage()
  12.         wait(20)
  13.         puppetSound(0)
  14.       else
  15.         set the locH of sprite activeSprite to the mouseH
  16.         set the locV of sprite activeSprite to the mouseV
  17.       end if
  18.     else
  19.       if (the locH of sprite activeSprite > (stickh2 - 70)) and (the locH of sprite activeSprite < (stickh2 + 70)) and (the locV of sprite activeSprite > (stickv2 - 40)) and (the locV of sprite activeSprite < (stickv2 + 40)) then
  20.         if side <> "Right" then
  21.           set the locH of sprite activeSprite to stickh2
  22.           set the locV of sprite activeSprite to stickv2
  23.           set snap2 to 1
  24.           puppetSound(0)
  25.           puppetSound("Floop.S")
  26.           updateStage()
  27.           wait(20)
  28.           puppetSound(0)
  29.         else
  30.           set the locH of sprite activeSprite to the mouseH
  31.           set the locV of sprite activeSprite to the mouseV
  32.         end if
  33.       else
  34.         set the locH of sprite activeSprite to the mouseH
  35.         set the locV of sprite activeSprite to the mouseV
  36.       end if
  37.     end if
  38.   else
  39.     if snap1 and ((the mouseH < (stickh1 - 70)) or (the mouseH > (stickh1 + 70)) or (the mouseV < (stickv1 - 40)) or (the mouseV > (stickv1 + 40))) then
  40.       set the locH of sprite activeSprite to the mouseH
  41.       set the locV of sprite activeSprite to the mouseV
  42.       set snap1 to 0
  43.     end if
  44.     if snap2 and ((the mouseH < (stickh2 - 70)) or (the mouseH > (stickh2 + 70)) or (the mouseV < (stickv2 - 40)) or (the mouseV > (stickv2 + 40))) then
  45.       set the locH of sprite activeSprite to the mouseH
  46.       set the locV of sprite activeSprite to the mouseV
  47.       set snap2 to 0
  48.     end if
  49.   end if
  50.   updateStage()
  51.   go(the frame)
  52. end
  53.  
  54. on mouseUp
  55.   global activeSprite, snap1, snap2, homeH, homeV, incCount, LbalanceHList, LbalanceVList, RbalanceHList, RbalanceVList, offLeft, offRight, onScaleList
  56.   if (the locH of sprite activeSprite <> homeH) or (the locV of sprite activeSprite <> homeV) then
  57.     if not snap1 and not snap2 then
  58.       set the locH of sprite activeSprite to homeH
  59.       set the locV of sprite activeSprite to homeV
  60.       if offLeft then
  61.         Seg2()
  62.         moveMiddle()
  63.         set the locV of sprite activeSprite to homeV
  64.         setAt(onScaleList, activeSprite - 23, 0)
  65.       end if
  66.       if offRight then
  67.         Seg1()
  68.         moveMiddle()
  69.         set the locV of sprite activeSprite to homeV
  70.         setAt(onScaleList, activeSprite - 23, 0)
  71.       end if
  72.       puppetSound(0)
  73.       go("S")
  74.     else
  75.       puppetSound(0)
  76.       if snap1 then
  77.         if not offLeft then
  78.           Seg1()
  79.           moveMiddle()
  80.         end if
  81.         go("S")
  82.       end if
  83.       if snap2 then
  84.         if not offRight then
  85.           Seg2()
  86.           moveMiddle()
  87.         end if
  88.         go("S")
  89.       end if
  90.     end if
  91.   else
  92.     set the locH of sprite activeSprite to homeH
  93.     set the locV of sprite activeSprite to homeV
  94.     if offLeft then
  95.       Seg2()
  96.       moveMiddle()
  97.       set the locV of sprite activeSprite to homeV
  98.       setAt(onScaleList, activeSprite - 23, 0)
  99.     end if
  100.     if offRight then
  101.       Seg1()
  102.       moveMiddle()
  103.       set the locV of sprite activeSprite to homeV
  104.       setAt(onScaleList, activeSprite - 23, 0)
  105.     end if
  106.     puppetSound(0)
  107.     go("S")
  108.   end if
  109. end
  110.